<template>
  <div>
    <!--  菜单  -->
    <el-radio-group v-model="isCollapse" style="margin-bottom: 20px;">
      <el-radio-button :label="false">展开</el-radio-button>
      <el-radio-button :label="true">收起</el-radio-button>
    </el-radio-group>
    <el-menu default-active="1-4-1" class="el-menu-vertical-demo show-top" @open="handleOpen" @close="handleClose" :collapse="isCollapse">
      <el-menu-item index="1" disabled>
        <i class="el-icon-document"></i>
        <span slot="title">租户中心</span>
      </el-menu-item>
      <el-menu-item index="2">
        <template slot="title">
          <i class="el-icon-edit"></i>
          <span slot="title" @click="gotoUserManager()">用户管理</span>
        </template>
      </el-menu-item>
      <el-menu-item index="3">
        <i class="el-icon-edit"></i>
        <span slot="title" @click="gotoPersonalCenter()">个人中心</span>
      </el-menu-item>
      <el-menu-item index="4">
        <i class="el-icon-circle-close"></i>
        <span slot="title">退出</span>
      </el-menu-item>
    </el-menu>
    <!--主要信息-->
    <div id="center">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  name: "LesseeCenter",
  data() {
    return {
      //menu
      isCollapse: true,
    }
  },
  methods:{
    //菜单函数
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    gotoUserManager(){
      this.$router.push("/lessee-center/user-manage");
    },
    gotoPersonalCenter(){
      this.$router.push("/lessee-center/personal-center");
    }
  },
  mounted() {
    this.$router.push("/lessee-center/user-manage");
  }
}
</script>

<style scoped>
/*菜单样式*/
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 200px;
  min-height: 400px;
}
/*主要组件样式*/
#center{
  background-color: lightblue;
  position: absolute;
  display: grid;
  justify-content: center;
  left: 0;
  top: 15%;
  height: 70%;
  width: 100%;
  z-index: -1;
}

#center:hover{
  z-index: 0;
}
</style>